
<!--
 * @Author: wang_sheshe
 * @Date: 2021-05-17 15:04:17
 * @LastEditTime: 2021-07-17 15:14:58
 * @Description: 巡视开始信息确认页
-->
<template>
	<article class="bg_4dbfae">
		<!-- 头组件 -->
        <van-nav-bar title="隐患详情" left-text="" left-arrow @click-left="back" fixed>
        </van-nav-bar>
        <div class="content1">
            <van-cell class="content-title" :border="false">
                <template slot="title">
                    <span class="border-icon"></span>
                    <span>隐患发现信息</span>
                </template>
            </van-cell>
            <van-cell-group class="content-list" :border="false">
                <van-cell title="隐患来源:" :value="hiddenDangerInfo.hazardSourceType"></van-cell>
                <van-cell title="发现人:" :value="hiddenDangerInfo.discovererPeople" />
                <van-cell title="隐患分级发现日期:" :value="showFormatDate(hiddenDangerInfo.discoveryDate)" />
                <van-cell title="发现班组:" :value="hiddenDangerInfo.discoveryGroupName" />
                <van-cell title="发现人单位:" :value="hiddenDangerInfo.discoveryOrgName" />
                <van-cell title="登记时间:" :value="showFormatDate(hiddenDangerInfo.registerDate)" />
                <van-cell title="登记人:" :value="hiddenDangerInfo.registrantName" />
            </van-cell-group>  
        </div>
        <div>
            <van-cell class="content-title" :border="false">
                <template slot="title">
                    <span class="border-icon"></span>
                    <span>隐患描述信息</span>
                </template>
            </van-cell>
            <van-cell-group class="content-list" :border="false">
                <van-cell title="隐患分级:" :value="hiddenDangerInfo.hazardGrade"></van-cell>
                <van-cell title="隐患分类:" :value="hiddenDangerInfo.hazardClassify" />
                <van-cell title="隐患类型:" :value="hiddenDangerInfo.hazardType" />
                <van-cell title="共性隐患:" :value="showFormatCommom(hiddenDangerInfo.isCommonHazard)" />
                <van-cell title="拟采取措施:" :value="hiddenDangerInfo.planToTakeMeasures" />
                <van-cell title="隐患描述:" :value="hiddenDangerInfo.hazardDescription" />
                <van-cell title="隐患状态:" :value="showFormatStatue(hiddenDangerInfo.hazardStatus)" />
            </van-cell-group>  
        </div>
	</article>
</template>

<script type="text/javascript">
	import Util from "@/utils/util"
	export default {
		name: 'DefectManage',
        props:{
            hiddenDangerInfo:{
                type:Object,
                default: function() {
                    return {}
                }
            },
        },
		data() {
			return {
				
			}
		},
        computed:{
            showFormatDate() {//日期格式
                return function(val) {
                    return Util.DateUtil.getFormatDateByLong(val,'yyyy-MM-dd hh:mm')
                }
            },
            showFormatCommom() {//是否共性
                return function(val) {
                    return val == "0" ? "是":"否";
                }
            },
            showFormatStatue() {//隐患状态
                return function(val) {
                    //0-隐患登记 1-审核 2-隐患处理 3-消除确认 4-结束
                    var name = "";
                    switch (val) {
                        case '0':
                            name = "隐患登记"
                            break;
                        case '1':
                            name = "审核"
                            break;
                        case '2':
                            name = "隐患处理"
                            break;
                        case '3':
                            name = "消除确认"
                            break;
                        case '4':
                            name = "结束"
                            break;
                        default:
                            name = ""
                            break;
                    }
                    return name;
                }
            }
        }
		,
		methods: {
			back() {
                this.$emit("closeDetail")
            }
		},
		mounted() {
			console.log("hiddenDangerInfo",this.hiddenDangerInfo)
		},
		
	}
</script>

<style scoped>
    article {
		display: flex;
		flex-direction: column;
		height: 100vh;
        font-family: 微软雅黑;
        background: #ffffff;
	}
    .content1{
        margin-top:45px;
    }
    .content-title .van-cell__title{
        font-size: 18px;
        color: #333;
    }
    .content-title .van-cell__value{
        font-size: 12px;
        color: #999;
    }
    .border-icon{
        width: 2px;
        height: 15px;
        border-radius: 10px;
        display: inline-block;
        background:#3CDAA8;
    }
    .content-list{
        width: calc(100% - 30px);
        margin: 10px 15px;
    }
    .content-list .van-cell{
        background-color: #F2F2F2;
    }
    .content-list .van-cell .van-cell__title{
        color: #999;
    }
    .content-list .van-cell .van-cell__value{
        color: #333;
    }
    .content-list .van-cell .van-cell__label{
        color: #333;
    }
</style>
